﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using BiffenServiceLibary;

namespace BiffenServiceLibary 
{
    class Program
    {

        static void DisplayHostInfo(ServiceHost host)
        {
            Console.WriteLine();

            
            Console.WriteLine("********* Start Host Info*********");
            foreach (System.ServiceModel.Description.ServiceEndpoint se in host.Description.Endpoints)
            {
                Console.WriteLine("Address: {0}", se.Address);
                Console.WriteLine("Binding: {0}", se.Binding.Name);
                Console.WriteLine("Contract: {0}", se.Contract.Name);
                Console.WriteLine();
            }
            Console.WriteLine("******** End Host Info **********");
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Console Based WCF Host");
            using (ServiceHost serviceHost = new ServiceHost(typeof(RemoteBookingSystem)))
            {
                serviceHost.Open();
                DisplayHostInfo(serviceHost);
                Console.WriteLine("The service is ready.");
                Console.WriteLine("Press the Enter key to terminate service.");
                Console.ReadLine();
            }
        }

    }
}
